package com.zhisheng.controller;

import com.zhisheng.dto.EmpLoginDto;
import com.zhisheng.pojo.MyResponseResult;
import com.zhisheng.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 员工管理Controller
 */
@RestController
public class EmpLoginController {

    @Autowired
    private EmpService empService;

    @PostMapping("/login")
    public MyResponseResult<String> login(@RequestBody EmpLoginDto dto){
        // 参  调  响
        // 成功就返回 令牌,不成功就返回null.给前端返回   NOT_LOGIN
        return empService.login(dto);
    }

}
